package com.xzj.admin.auth.controller;

import com.xzj.admin.auth.service.AdminAuthService;
import com.xzj.admin.base.domain.SysUserInfo;
import com.xzj.common.core.domain.vo.R;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @program: xzj-admin
 * @ClassName: AdminAuthController
 * @description: 认证服务
 * @author: XiaZunJun
 * @create: 2024-06-27 17:15
 */
@RestController
@Slf4j
public class AdminAuthController {

    @Resource
    private AdminAuthService adminAuthService;

    @PostMapping("/login")
    public SysUserInfo login(@RequestBody SysUserInfo sysUserInfo) {
        return adminAuthService.login(sysUserInfo);
    }

    @GetMapping("/logout")
    public void logout() {
        adminAuthService.logout();
    }

    @GetMapping("/getUserInfo")
    public SysUserInfo getUserInfo() {
        return adminAuthService.getUserInfo();
    }

    @GetMapping("/getMenuList")
    public R getMenuList() {
        return adminAuthService.getMenuList();
    }

    @GetMapping("/getPermCode")
    public R getPermCode() {
        return adminAuthService.getPermCode();
    }

}
